<?php
/**
 * index.php
 * @author 瀚海浪亭
 * @email  1171672036@qq.com
 * @date   2021/4/19
 */

use think\facade\Route;
use Tools\Responses;

Route::group(function () {
    // 路由示例模板
//    Route::group('template', function () {
//        Route::post('list', 'api/Template/lists');
//        Route::post('detail', 'api/Template/detail');
//        Route::post('create', 'api/Template/create');
//        Route::post('update', 'api/Template/update');
//        Route::post('delete', 'api/Template/delete');
//    });

    // 公用
    Route::group('public', function () {
        Route::post('login', 'Public/login');
        Route::post('register', 'Public/register');
        Route::post('image', 'Public/image');
        Route::post('sms', 'Public/sms');
        Route::post('email', 'Public/email');
    });

    // 用户
    Route::group('user', function () {
        Route::post('list', 'User/lists');
        Route::post('detail', 'User/detail');
        Route::post('create', 'User/create');
        Route::post('update', 'User/update');
        Route::post('delete', 'User/delete');
    });

    Route::miss(function () {
        return Responses::data(404, '接口不存在');
    });
})->allowCrossDomain();
